package homework.ooday03._cp.management;

public class Test {
    public static void main(String[] args) {
        Staff[] staffs = new Staff[8];
        staffs[0] = new General("总监1",20,20000);
        staffs[1] = new Teacher("讲师1",30,10000);
        staffs[2] = new ProjectManager("项目经理1",40,6000);
        staffs[3] = new HeadTeacher("班主任1",50,8000);

        staffs[4] = new ProjectManager("项目经理2",40,6000);
        staffs[5] = new Teacher("讲师2",30,10000);
        staffs[6] = new HeadTeacher("班主任2",50,8000);
        staffs[7] = new General("总监2",20,20000);

        for(int i=0;i<staffs.length;i++){
            Staff s = staffs[i];
            System.out.println(s.name+","+s.age+","+s.salary);
            s.finishWork();
            if(s instanceof SolveProblems){
                SolveProblems sp = (SolveProblems)s;
                sp.solveProblems();
            }
            if(s instanceof TrainEmployees){
                TrainEmployees t = (TrainEmployees)s;
                t.trainEmployees();
            }
            if(s instanceof EditBooks){
                EditBooks e = (EditBooks)s;
                e.editBooks();
            }
        }
    }
}
